﻿@{
	Layout = null;
}
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title></title>
	<script src=~/axios.min.js></script>
</head>
<body>
	<h1>Home Index Client</h1>
	<div>
		<input type="file" id="file" onchange="foo(event)">
	</div>
	<div>
		<button onclick="ok()">点击</button>
	</div>
	<script>
		axios.get("/api/get",{
			params:{ name: "哈哈" }
		});

		axios.get("/api/getjson",{
			params:{ name: "哈哈" }
		});

		var par = new URLSearchParams();
		par.append("name","哈哈");
		axios.post("/api/post",par);

		axios.post("/api/postbody",{
			params:{ name: "哈哈" }
		});

		function foo(event) {
			formdata = new FormData();
			formdata.append('file',event.target.files[0]);
			formdata.append('action','test');
			axios.post("/api/postfile",formdata);
		}

		function ok(){
			axios.get("/api/get",{
				params:{ name: "哈哈" }
			});
		}
	</script>
</body>
</html>